# Contributor: Patrycja Rosa <alpine@ptrcnull.me>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=py3-zopfli
pkgver=0.2.3
pkgrel=0
pkgdesc="Python bindings to zopfli"
url="https://github.com/fonttools/py-zopfli"
arch="all"
license="Apache-2.0"
depends="python3"
makedepends="python3-dev zopfli-dev py3-wheel py3-setuptools py3-setuptools_scm"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://github.com/fonttools/py-zopfli/archive/refs/tags/v$pkgver/py3-zopfli-$pkgver.tar.gz"
builddir="$srcdir/py-zopfli-$pkgver"

export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver

build() {
	USE_SYSTEM_ZOPFLI=1 python3 setup.py build
}

check() {
	PYTHONPATH=$(echo build/lib.*) pytest
}

package() {
	python3 setup.py install --skip-build --prefix=/usr --root="$pkgdir"
}

sha512sums="
071e897270a5af893670a3744d5bec9557cc80ea3ad29dd7bf44e990e8db8a9d1eaa6b8e8bfab38094cfba00d18ee3ff393f729aa95242a52bdfac3535097efb  py3-zopfli-0.2.3.tar.gz
"
